Forgive me if this sounds stupid.... But can one open and read a DCR (in the content store) in a FormAPI script?TS 6.7.1 SP2, Win 2003 Server.
Thanks fish. I was of the same opinion. Call server seemed to be the only option to achieve this from the FormAPI.I just wanted to confirm my understanding.
Call Sever is not your only option. From DCR1 FormAPI you can open a DCR2 using CC URL Command edit. Like that:var DCRHandle = window.open('/iw/webdesk/edit?vpath=Your Target DCR Vpath', 'Target DCR', 'Your Window Specs');With DCRHandle you can access Target DCR's FormAPI functions, open/close/edit Target Form, whatever...
Hmm - interesting - but this requires that the second DCR be opened up visually - right?I was under the impression that the desire was to do it all programmatically without the user seeing a second window pop-up.I suppose you could try to set the coordinates for the new window to be off-screen, but that tends to have confusing results with regard to focus and having the icon/tab appear for the window in the bottom tray (or whatever you call that thing across the bottom of Windows)
From DCR1 FormAPI you can open a DCR2 using CC URL Command edit. Like that:var DCRHandle = window.open('/iw/webdesk/edit?vpath=Your Target DCR Vpath', 'Target DCR', 'Your Window Specs');With DCRHandle you can access Target DCR's FormAPI functions, open/close/edit Target Form, whatever...I am trying this. what is happening is i can open the target DCR as new window. However, i don't seem to get access to the objects of my target DCR which i opened up. Like form api elements or something. i can't even get the values. my dilema is how i can best use form api on the target DCR that opens upI already am using getScriptFrame but that referes to the parent window or the window that opens the target DCR.Please suggest something here. I am actually new to this.
I already am using getScriptFrame but that referes to the parent window
// Note that the following code has not been tested// Keep this pair of variables global, you'll need them in other places as wellvar targetHandle;var targetScriptFrame;function showTarget(dcrVPath) { var tagpath = "/iw/webdesk/edit?vpath=" + dcrVPath; targetHandle = window.open(tagpath,"_blank","left=100,top=100,width=500,height=400,status=yes,toolbar=no,location=no,resizable=yes,scrollbars=yes"); gainTargetAccess();}function gainTargetAccess() { var errorMsg; if (targetHandle) if ((typeof targetHandle.top.gIsInitialRender=="undefined") || (targetHandle.top.gIsInitialRender==true)) { setTimeout("gainTargetAccess()", 500); else try {targetScriptFrame = targetHandle.parent.getScriptFrame();} catch (err) {errorMsg = err.description;} else errorMsg = "Error - Undefined Handle!"; if (errorMsg) alert(errorMsg);}
Thanks, I thought i will try this out. However, when i try to get the handle on the target DCR, it gives me an error saying "Object does not support this property or method". I guess this is due to the target DCR's form api function not getting supported? I am however, able to open the target DCR. Could you suggest on this....Thanks,A